package com.pi.shisan.component.util;

import java.util.concurrent.Callable;

public class ComponentThread {

    private final static SingleThreadRunner singleThreadRunner = new SingleThreadRunner("led-platform");

    public static void execute(Runnable runnable) {
        try {
            singleThreadRunner.execute(runnable);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static <T>T submit(Callable<T> callable) throws Exception {
        return singleThreadRunner.submit(callable);
    }

    public static void exit() {
        singleThreadRunner.exit();
    }
}
